<template>
  <img
  class="avatar-container"
  :src="url" :style="{
    width: size + 'px',
    height: size + 'px'
  }" :alt="alt" :title="title">
</template>

<script>
export default {
  props: {
    url: {
      type: String,
      required: true
    },
    size: {
      type: Number,
      default: 150
    },
    alt: {  
      type: String,
      required: false
    },
    title: String
  }
}
</script>

<style lang="less" scoped>
.avatar-container {
  border-radius: 50%;
  object-fit: cover; // 设置图片在容器内保持比例
  display: block;
}

</style>